from django.db import models

# Create your models here.
class ZiZhu(models.Model):
    name = models.CharField(max_length=30)
    price = models.CharField(max_length=5000)
    type = models.IntegerField(choices=((0,'普通会员'),(1,'高级会员')))
    status = models.IntegerField(choices=((0,'正在吃'),(1,'已吃完')))

class User(models.Model):
    username = models.CharField(max_length=30)
    password = models.CharField(max_length=50)

class Meishi(models.Model):
    user = models.ForeignKey(User,on_delete=models.CASCADE)
    zizhu = models.ForeignKey(ZiZhu,on_delete=models.CASCADE)
    start_time = models.DateTimeField(null=True,blank=True)
    end_time = models.DateTimeField(null=True,blank=True)
    total_money = models.DecimalField(max_digits=7,decimal_places=2,null=True,blank=True)
